<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function load() {
            console.info(document.all.d1.innerHTML);
            console.info(document.forms[0].action)
        }
        function changall(ele) {
            var chks = document.getElementsByName("ls");

            // chks = [...chks]; // htmlcollection --> 数组
            chks.forEach(i => i.checked = ele.checked);
        }

        var a1 = [1, 2]
        var a2 = [3, 4]
//        var a4 = {"0":5, "1":6, "length":2}
//        a4.__proto__=new Array();
        var a3 = [...a1,...a2]
        console.info(a3)
    </script>
</head>
<body onload="load()">
    <form action="abc.do">
    全选        <input type="checkbox" name="chkall" onchange="changall(this)" />
        a<input type="checkbox" value=1 name="ls" />
        b<input type="checkbox" value=2 name="ls" />
        c<input type="checkbox" value=3 name="ls" />
        d<input type="checkbox" value=4 name="ls" />
        e<input type="checkbox" value=5 name="ls" />
    </form>
    <div id="d1">hello world</div>
    <div class="d2"> hhhhhh222</div>
    <div class="d2">hhhhhh111</div>
    <script>

       document.getElementsByClassName("d2")[0].style = 'border: 1px solid red'
    </script>
</body>
</html>